<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Paginas extends CI_Controller {

    
     public function __construct() {
        parent::__construct();

        $this->load->helper('url');
        //$this->load->model('peliculas_model');
        //$this->load->model('actores_model');

    }
    
    public function index() {

           $this->vista();
        
        /*
 * 
 * 
 * 
 * 
        echo "No ha indicado ningún método";
        
        if (!file_exists(APPPATH . '/views/paginas/' . $paginas . '.php')) {
            echo  "Whoops, we don't have a page for that!";
            show_404();
        }
        
        $data['title'] = ucfirst($paginas); // Capitalize the first letter

        $this->load->view('templates/header', $data);
        $this->load->view('paginas/home', $data);
        $this->load->view('templates/footer', $data);
     */   
    }

    
    public function vista($paginas = 'home') {

         $this->load->helper('url');

        if (!file_exists(APPPATH . '/views/paginas/' . $paginas . '.php')) {
            // Whoops, we don't have a page for that!
            show_404();
        }

        $data['title'] = ucfirst($paginas); // Capitalize the first letter

        $this->load->view('templates/header', $data);
        $this->load->view('paginas/home', $data);
        $this->load->view('templates/footer', $data);
    }
    
    
    public function about() {
        // $this->load->helper('url');
        
        $this->load->view('templates/header');
        $this->load->view('paginas/about');
        $this->load->view('templates/footer');
    }
    
    public function contacto() {
        // $this->load->helper('url');
        
        $this->load->view('templates/header');
        $this->load->view('paginas/contacto');
        $this->load->view('templates/footer');
    }
    
    public function home() {
        // $this->load->helper('url');
        
        $this->load->view('templates/header');
        $this->load->view('paginas/home');
        $this->load->view('templates/footer');
    }
    
    public function promociones() {
        // $this->load->helper('url');
        
        $this->load->view('templates/header');
        $this->load->view('paginas/promociones');
        $this->load->view('templates/footer');
    }

}
